/**
 * 
 * 提示用户输入年月日信息，判断这一天是这一年中的第几天并打印
 * 
*/


import java.util.Scanner;

public class YearDays {

    public static void main(String[] args){

        System.out.println("请输入年月日");

        Scanner sc = new Scanner(System.in);
        int year = sc.nextInt();
        int month = sc.nextInt();
        int day = sc.nextInt();

        if(year < 0){
            System.out.println("输入了错误的年份");
            return;
        }
        
        if(month < 0 || month > 12){
            System.out.println("输入了错误的月份");
            return;
        }

        if(day < 0){
            System.out.println("输入了错误的日期");
            return;
        }


        int febDays = 28;
        if((year%4 == 0 && year%100 != 0) || year%400 == 0){
            //是闰年
            febDays = 29;
        }

        int result = 0;
        //利用switch的穿透性
        switch (month-1) {
            // case 12:
            //     result += 31;

            case 11:
                result += 30;

            case 10:
                result += 31;

            case 9:
                result += 30;

            case 8:
                result += 31;

            case 7:
                result += 31;

            case 6:
                result += 30;

            case 5:
                result += 31;

            case 4:
                result += 30;

            case 3:
                result += 31;
                
            case 2:
                result += febDays;

            case 1:
                result += 31;
        
            default:
                break;
        }

        result += day;
        System.out.println("输入了" + year + "年" + month + "月" + day + "日");
        System.out.println("这一天是第" + result + "天");
    }
    
}
